#include "helmdata.h"
#include "buffs.h"
#include "symbol.h"
#include "creature.h"
#include "message.h"

bool Helm::ItemSymbol( IO::Sym* symbol ) const
{
    symbol->first = '[';
    return true;
}

bool Helm::ItemType( uint* type ) const
{
    *type |= WEARABLE_HEAD | WIELDABLE_1H;
    return true;
}

bool Helm::ItemCategory( uint* category ) const
{
    *category = ARMOUR;
    return true;
}

bool LeatherCap::Name( std::string* name, bool* plural, uint article ) const
{
    if ( name->empty() && article == ARTICLE_INDEFINITE )
        *name += "a ";
    if ( article == ARTICLE_PLURAL )
        *name += "leather caps";
    else
        *name += "leather cap";
    return true;
}

bool LeatherCap::ItemSymbol( IO::Sym* symbol ) const
{
    Helm::ItemSymbol( symbol );
    symbol->second = Colour( 192, 128, 64 );
    return true;
}

bool LeatherCap::CreateWearBuff( CompoundBuff** buff ) const
{
    ( *buff )->AddBuff( new StatsBuff( 0, 0, 0, 0, 0, 1, 0, 0 ) );
    return true;
}

bool LeatherCap::Flammable( uint* flammableType ) const
{
    *flammableType |= FLAMMABLE_BURN_LONG | FLAMMABLE_SMOULDER_SHORT | FLAMMABLE_CHAR;
    return true;
}

bool LeatherCap::ItemWeight( uint* weight ) const
{
    *weight += 15;
    return true;
}

bool LeatherCap::OnEaten( Creature* c )
{
    uint fire;
    Call< BIFire >( &fire );
    if ( fire & BIFire::FIRE_CHARRED )
        Bank().Manipulation( MANIPULATION_EAT_CHARRED_LEATHER, c, this );
    else
        Bank().Manipulation( MANIPULATION_EAT_LEATHER, c, this );
    Destroy();
    return true;
}
